package gl.android.biyiqing.fragment;

import gl.android.biyiqing.LoveAskListActivity;
import gl.android.biyiqing.NearPeopleActivity;
import gl.android.biyiqing.PsychTestListActivity;
import gl.android.biyiqing.R;
import gl.android.biyiqing.YaoYiYaoActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.LinearLayout;

public class DiscoverFragment extends BaseFragment implements OnClickListener {
	// Content View Elements

	private LinearLayout item_discover_1;
	private LinearLayout item_discover_2;
	private LinearLayout item_discover_3;
	private LinearLayout item_discover_4;

	// End Of Content View Elements

	private void bindViews() {

		item_discover_1 = (LinearLayout) rootView
				.findViewById(R.id.item_discover_1);
		item_discover_2 = (LinearLayout) rootView
				.findViewById(R.id.item_discover_2);
		item_discover_3 = (LinearLayout) rootView
				.findViewById(R.id.item_discover_3);
		item_discover_4 = (LinearLayout) rootView
				.findViewById(R.id.item_discover_4);
		item_discover_1.setOnClickListener(this);
		item_discover_2.setOnClickListener(this);
		item_discover_3.setOnClickListener(this);
		item_discover_4.setOnClickListener(this);
	}

	public static DiscoverFragment newInstance() {
		DiscoverFragment fragment = new DiscoverFragment();
		Bundle args = new Bundle();
		fragment.setArguments(args);
		return fragment;
	}

	public DiscoverFragment() {
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		rootView = inflater.inflate(R.layout.fragment_discover, container,
				false);
		bindViews();
		initData();
		return rootView;
	}

	private void initData() {

	}
	@Override
	public void onClick(View arg0) {
		if (!isValueFragment()) {
			return;
		}
		switch (arg0.getId()) {
		case R.id.item_discover_1:
			startActivity(new Intent(getActivity(), YaoYiYaoActivity.class));
			break;
		case R.id.item_discover_2:
			startActivity(new Intent(getActivity(), NearPeopleActivity.class));
			break;
		case R.id.item_discover_3:
			startActivity(new Intent(getActivity(), PsychTestListActivity.class));
			break;
		case R.id.item_discover_4:
			startActivity(new Intent(getActivity(), LoveAskListActivity.class));
			break;

		default:
			break;
		}

	}

}
